import React, { Component } from 'react';

class login extends Component {
    state = {
        name:'',
        pwd:''
    }
    setName(e){
        this.setState ({
            name:e.target.value
        })
    }
    
    setPwd(e){
        this.setState({
            pwd:e.target.value
        })
    }
    render() {
        return (
            <div>
                <label>
                姓名 : &nbsp;
                <input placeholder={'请输入用户名'} type='text' value={this.state.name} onChange={this.setName.bind(this)}/>
                </label>
                
                <br></br>
                <label>
                密码 : &nbsp;
                <input placeholder={'请输入密码'} type='text' value={this.state.pwd} onChange={this.setPwd.bind(this)}/>
                </label>
                
            </div>
        );
    }
}

export default login;
